local nya__hongyan = fk.CreateSkill {

  name = "nya__hongyan",

  tags = { Skill.Compulsory, },

}



nya__hongyan:addEffect("filter", {
  name = "nya__hongyan",
  frequency = Skill.Compulsory,
  card_filter = function(self, to_select, player)
    return player:hasSkill(nya__hongyan.name) and to_select.suit == Card.Spade
  end,
  view_as = function(self, player,to_select)
    return Fk:cloneCard(to_select.name, Card.Heart, to_select.number)
  end,
})

nya__hongyan:addEffect(fk.FinishJudge, {
  name = "#nya__hongyan_trigger",
  mute = true,
  frequency = Skill.Compulsory,
  events = {fk.FinishJudge},
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill("nya__hongyan") and not target:hasSkill("nya__play", true) and data.card.suit == Card.Heart
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:broadcastSkillInvoke("nya__hongyan")
    room:notifySkillInvoked(player, "nya__hongyan", "support")
    if player:isWounded() then
      room:recover{
        who = player,
        num = 1,
        recoverBy = player,
        skillName = "nya__hongyan",
      }
    end
    if not player.dead then
      player:drawCards(1, "nya__hongyan")
    end
  end,
})

return nya__hongyan